package com.adgox.tiantianbiting.mine.wallet;

import com.adgox.tiantianbiting.bean.BaseResponseBean;
import com.adgox.tiantianbiting.bean.RechargeInfoBean;
import com.adgox.tiantianbiting.net.callback.JsonCallback;
import com.adgox.tiantianbiting.utils.ApiConstant;
import com.lzy.okgo.OkGo;
import com.lzy.okgo.model.Response;

import java.util.List;

/**
 * Created by tang on 2018/12/31.
 */

public class MyWalletPresenterImpl implements MyWalletContract.Presenter {

    MyWalletContract.View mView ;

    public MyWalletPresenterImpl(MyWalletContract.View mView) {
        this.mView = mView;
        mView.setPresenter(this);
    }

    @Override
    public void start() {

    }

    @Override
    public void getRechargeInfo() {
        OkGo.<BaseResponseBean<List<RechargeInfoBean>>>get(ApiConstant.BASE_URL+ApiConstant.GET_RECHARGE_INFO)
                .execute(new JsonCallback<BaseResponseBean<List<RechargeInfoBean>>>() {
                    @Override
                    public void onSuccess(Response<BaseResponseBean<List<RechargeInfoBean>>> response) {
                        mView.onSetRechargeInfo(response.body().getData());
                    }
                });
    }
}
